#ifndef LEAMHANDLERHH
#define LEAMHANDLERHH
#include "stdincludes.hh"
#include "leam-typedefs.hh"
#include "leam-data-in-stream.hh"

namespace leam
{
    //leam->system iface
    class ILeamHandler
    {
    public:
	virtual ~ILeamHandler(){}
	//This is wrapped in a handler for all exceptions.  If it is a
	//Licada exeption then the stack trace is sent as a message
	//(encoded as uint16 data).
	virtual void handleData( TMessageId msg, LeamDataInStream& data ) = 0;
	//The licada error systems gets a stack trace when an
	//exception goes.  If the error was licada based, then the
	//return value has the stack trace in in as well as any other
	//specific data.
	virtual void handleError( TMessageId msg, const std::string& stackTrace, LeamDataInStream& data ) = 0;
	//Acknowledged
	virtual void handleAck( TMessageId msg ) = 0;
	//Finished
	virtual void handleFin( TMessageId msg ) = 0;
	//Called when the *other* stream sends a close message.
	virtual void handleClose() = 0;
    };
}
#endif
